' Strict
SuperStrict

' Files
Import "Global.bmx"
Import "TEntity.bmx"

' TPlayer
Type TPlayer Extends TEntity
	' Init
	Method Init(scriptFile:String)
		Super.Init("")
		Super.InitStatus(1, 800, 300)
		
		' Skill slots
		Self.techSlots = New TSlot[4 + 4 + 1]
		
		' TODO: Remove hardcoded stuff
		Self.SetImageFile("chara-14.png")
		Self.animAttack.LoadConfig(FS_ROOT + "data/characters/chara-14.ini")
	End Method
	
	' SetImageFile
	Method SetImageFile(nFile:String)
		' TODO: Remove hardcoded stuff
		SetMaskColor 255, 255, 255
		
		Self.img = LoadAnimImage(FS_ROOT + "data/characters/" + nFile, 24, 32, 0, 24)
	End Method
	
	' SetMPEffectFunc
	Method SetMPEffectFunc(func() ) 
		Self.mpEffectFunc = func
	End Method
	
	' Update
	Method Update()
		Self.currentAnimation.Play()
		
		' HP regen
		If MilliSecs() - Self.lastHPRegen >= 1000
			Self.AddHP(Self.maxHP * Self.hpRegen)
			Self.lastHPRegen = MilliSecs()
		End If
		
		' MP regen
		If MilliSecs() - Self.lastMPRegen >= 1000
			Self.AddMP(Self.maxMP * Self.mpRegen)
			Self.lastMPRegen = MilliSecs()
		End If
	End Method
	
	' Die
	Method Die()
		
	End Method
	
	' Create
	Function Create:TPlayer(scriptFile:String)
		Local player:TPlayer = New TPlayer
		player.Init(scriptFile)
		Return player
	End Function
End Type
